#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <aclconio.h>
#include <define.h>
#include <transact.h>
#include <tran.h>
#include <gds.h>
#include <sizes.h>
#include "ConfProto.h"
#include "tblutil.h"
#include <\SOFTPAY\Ver30\source\include\sizes.h>
#include <\SOFTPAY\Ver30\HostSrc\citisrc\citiids.h>
#include <\SOFTPAY\Ver30\HostSrc\cpacsrc\cpacids.h>
#include <confio.h>

#include <\SOFTPAY\Ver30\source\include\CCT.h>

const char*CCTName = "CCT.dat";

static CCT_REC srCCTRec;

static int recordNum;
int	inLoadCCTRec (int inRecNumber)
{
	int inRet;

	inRet = inLoadConfRec(CCT_FILENAME, SIZE_CCT_REC, inRecNumber, (char *) &srCCTRec);

	recordNum = inRecNumber;
	return inRet;
}

void *pvdGetCCTRec(void)
{
	return &srCCTRec;

}

int	inSaveCCTRec (int inRecNumber)
{
	int inRet;

	inRet = inSaveConfRec(CCT_FILENAME, SIZE_CCT_REC, inRecNumber, (char *) &srCCTRec);

	return inRet;
}

int	inGetCCTRecNumber (void)
{
	return recordNum;
}

int	inUpdateCCTRec (void)
{
	int inRet;

	inRet = inSaveConfRec(CCT_FILENAME, SIZE_CCT_REC, recordNum, (char *) &srCCTRec);

	return inRet;
}

void	vdResetCCTRec (void)
{
	memset((void*)&srCCTRec, 0, REC_SIZEOF(srCCTRec));
}

short inGetTermCkrdrType(void)
{
	return srCCTRec.inTermCkrdrType;
}

void vdSetTermCkrdrType(short inTermCkrdrType)
{
	srCCTRec.inTermCkrdrType = inTermCkrdrType;
}

char* szGetTermPort(void)
{
	return srCCTRec.szTermPort;
}

void vdSetTermPort(const char* szTermPort)
{
	strNumCopy(srCCTRec.szTermPort, szTermPort, sizeof(((CCT_REC*)NULL)->szTermPort)-1);
}

short inGetTermBaud(void)
{
	return srCCTRec.inTermBaud;
}

void vdSetTermBaud(short inTermBaud)
{
	srCCTRec.inTermBaud = inTermBaud;
}

short inGetTermFormat(void)
{
	return srCCTRec.inTermFormat;
}

void vdSetTermFormat(short inTermFormat)
{
	srCCTRec.inTermFormat = inTermFormat;
}

short inGetTermHandshake(void)
{
	return srCCTRec.inTermHandshake;
}

void vdSetTermHandshake(short inTermHandshake)
{
	srCCTRec.inTermHandshake = inTermHandshake;
}

short inGetCheckEntryMode(void)
{
	return srCCTRec.inCheckEntryMode;
}

void vdSetCheckEntryMode(short inCheckEntryMode)
{
	srCCTRec.inCheckEntryMode = inCheckEntryMode;
}

